export function findP(vnode, func) {
  if (func(vnode)) return vnode;
  if (vnode.children?.length) {
    let found;
    for (const c of vnode.children)
      if (found = findP(c))
        return found;
  }
}
export function findC(vnode, func) {
  if (vnode.children?.length) {
    let found;
    for (const c of vnode.children)
      if (found = findC(c))
        return found;
  }
  if (func(vnode)) return vnode;
}
export function eachP(vnode, func) {
  func(vnode);
  if (vnode.children?.length) {
    for (const c of vnode.children)
      eachP(c);
  }
}
export function eachC(vnode, func) {
  func(vnode);
  if (vnode.children?.length) {
    for (const c of vnode.children)
      eachC(c);
  }
}